﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WowParserLib.Events.PrefixArgs;
using WowParserLib.Events.SuffixArgs;

namespace WowParserLib.Events
{
    public class SpellPeriodicDamage : SpellEvent
    {
        DamageArgs _damageSuffix;

        public override string ToString()
        {
            return base.ToString() + " " + _damageSuffix.Amount + ((_damageSuffix.Critical) ? "*" : "");//.SpellSchool;
        }

        protected override int getDamage()
        {
            return _damageSuffix.Amount - (_damageSuffix.Absorbed + _damageSuffix.Resisted);
        }

        protected override void initialize(params EventArguments[] args)
        {
            base.initialize(args);
            foreach (EventArguments arg in args)
            {
                if (arg is DamageArgs)
                {
                    _damageSuffix = arg as DamageArgs;
                }
            }
        }
    }
}